COMPIZ_PLUGINS="move resize place decoration animation"
# Use emerald by default if it exist
USE_EMERALD="yes"
# No indirect by default
INDIRECT="no"
# Default X.org log if xset q doesn't reveal it
XORG_DEFAULT_LOG="/var/log/Xorg.0.log"
# Set to yes to enable verbose
VERBOSE="yes"
# Echos the arguments if verbose
verbose()
{
if [ "x$VERBOSE" = "xyes" ]; then
printf "$*"
fi
}
# abort script and run fallback windowmanager
abort_with_fallback_wm()
{
if [ "x$SKIP_CHECKS" = "xyes" ]; then
verbose "SKIP_CHECKS is yes, so continuing despite problems.\n"
return 0;
fi
if [ "x$CM_DRY" = "xyes" ]; then
verbose "Dry run failed: Problems detected with 3D support.'n"
exit 1;
fi
verbose "aborting and using fallback: $FALLBACKWM \n"
if [ -x $FALLBACKWM ]; then
exec $FALLBACKWM $FALLBACKWM_OPTIONS
else
printf "no $FALLBACKWM found, exiting\n"
exit 1
fi
}
# Check if we run with the Software Rasterizer, this happens e.g.
# when a second screen session is opened via f-u-a on intel
check_software_rasterizer()
{
verbose "Checking for Software Rasterizer: "
if glxinfo 2> /dev/null | egrep -q '^OpenGL renderer string: Software Rasterizer' ; then
verbose "present. \n";
return 0;
else
verbose "Not present. \n"
return 1;
fi
}
# Check for non power of two texture support
check_npot_texture()
{
verbose "Checking for non power of two support: "
if glxinfo 2> /dev/null | egrep -q '(GL_ARB_texture_non_power_of_two|GL_NV_texture_rectangle|GL_EXT_texture_rectangle|GL_ARB_texture_rectangle)' ; then
verbose "present. \n";
return 0;
else
verbose "Not present. \n"
return 1;
fi
}
# Check for presence of FBConfig
check_fbconfig()
{
verbose "Checking for FBConfig: "
if [ "$INDIRECT" = "yes" ]; then
$GLXINFO -i | grep -q GLX.*fbconfig
FB=$?
else
$GLXINFO | grep -q GLX.*fbconfig
FB=$?
fi
if [ $FB = "0" ]; then
unset FB
verbose "present. \n"
return 0;
else
unset FB
verbose "not present. \n"
return 1;
fi
}
# Check for TFP
check_tfp()
{
verbose "Checking for texture_from_pixmap: "
if [ $($GLXINFO 2>/dev/null | grep -c GLX_EXT_texture_from_pixmap) -gt 2 ] ; then
verbose "present. \n"
return 0;
else
verbose "not present. \n"
if [ "$INDIRECT" = "yes" ]; then
unset LIBGL_ALWAYS_INDIRECT
INDIRECT="no"
return 1;
else
verbose "Trying again with indirect rendering:\n";
INDIRECT="yes"
export LIBGL_ALWAYS_INDIRECT=1
check_tfp;
return $?
fi
fi
}
# Check wether the composite extension is present
check_composite()
{
verbose "Checking for Composite extension: "
if xdpyinfo -queryExtensions | grep -q Composite ; then
verbose "present. \n";
return 0;
else
verbose "not present. \n";
return 1;
fi
}
# Detects if Xgl is running
check_xgl()
{
verbose "Checking for Xgl: "
if xvinfo | grep -q Xgl ; then
verbose "present. \n"
return 0;
else
verbose "not present. \n"
return 1;
fi
}
# Check if the nVidia card has enough video ram to make sense